package com.situ.firmadmin.controller;


import com.situ.firmadmin.pojo.RoleType;
import com.situ.firmadmin.service.IRoleTypeService;
import com.situ.firmadmin.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/role")
public class RoleTypeController {
    @Autowired
    private IRoleTypeService roleTypeService;

    @GetMapping("/selectAll")
    public Result selectAll(){
        List<RoleType> list = roleTypeService.selectAll();
        return Result.ok(list);
    }
    
    @GetMapping("/selectById/{role}")
    public Result selectById(@PathVariable Integer role){
        RoleType roleType = roleTypeService.selectById(role);
        return Result.ok(roleType);
    }
    


}
